fix: (CDK) (AsyncRetriever) - fix the regression. The TIMEOUT Job Status should Retry on server status#432
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a regression with the TIMEOUT job status by enabling retries on timed‐out jobs and by making the retry behavior configurable with the job_max_retry parameter.
- Added a TODO comment in the async job to indicate future improvements in handling TIMEOUT responses.
- Updated AsyncPartition and AsyncJobOrchestrator to accept a configurable job_max_retry parameter and adjusted the logic to include TIMEOUT in the retry flow.
- Modified the Connector Builder path to set job_max_retry appropriately.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| airbyte_cdk/sources/declarative/async_job/job.py | Added a TODO comment regarding handling of TIMEOUT status; returns TIMED_OUT when timer expires. |
| airbyte_cdk/sources/declarative/async_job/job_orchestrator.py | Updated constructor and partition/retry handling to use job_max_retry; adjusted cleanup and abort logic for timed-out jobs. |
| airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py | Configured job_max_retry for the Connector Builder use-case to enforce a single retry when active. |
Comments suppressed due to low confidence (4)
airbyte_cdk/sources/declarative/async_job/job.py:37
- [nitpick] Consider enhancing this TODO comment with additional context or a reference to the intended API behavior to guide future improvements.
# TODO: we should account the fact that,
airbyte_cdk/sources/declarative/async_job/job_orchestrator.py:388
- Ensure that not freeing the job allocation for timed-out jobs is the intended design to allow for their retry; consider adding a clarifying comment.
self._abort_job(job, free_job_allocation=False)
airbyte_cdk/sources/declarative/async_job/job_orchestrator.py:406
- [nitpick] Confirm that omitting TIMED_OUT jobs from removal here aligns with the desired retry behavior for timed-out jobs.
if job.status() == AsyncJobStatus.COMPLETED:
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py:3080
- [nitpick] Verify that setting job_max_retry to 1 for Connector Builder use-cases is the intended behavior and that it is adequately covered by tests.
job_max_retry=1 if self._emit_connector_builder_messages else None,
📝 WalkthroughWalkthroughThis pull request introduces modifications to the handling of asynchronous jobs. In the Changes
Sequence Diagram(s)sequenceDiagram
participant Orchestrator as AsyncJobOrchestrator
participant Partition as AsyncPartition
participant Job as AsyncJob
participant Repo as AsyncJobRepository
Orchestrator->>Partition: Create partition (pass job_max_retry)
Partition->>Job: Start job execution
Note over Job,Partition: Job execution monitored for timeout or failure
alt Job experiences timeout
Partition->>Partition: Check has_reached_max_attempt(job_max_retry)
alt Retry limit not reached
Partition->>Orchestrator: Request job retry/replacement
else Retry limit reached
Partition->>Orchestrator: Abort job without retry
end
end
Possibly related PRs
Suggested reviewers
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (9)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Maxime Carbonneau-Leclerc (maxi297)
left a comment
There was a problem hiding this comment.
Confirming that this fixes the tests in source-salesforce. Thanks a lot Baz (@bazarnov) ❤️ !
What
Given this dialog: https://airbytehq-team.slack.com/archives/C07JMAAE620/p1742346710533189?thread_ts=1742236041.905529&cid=C07JMAAE620
Related to:
TIMEOUTJobs are retried, ignoring thepolling_job_timeoutsetting #429Summary by CodeRabbit